# Contributor: Jeremy Thomerson <jeremy@thomersonfamily.com>
# Maintainer: Jeremy Thomerson <jeremy@thomersonfamily.com>
pkgname=rdiff-backup
pkgver=2.2.6
pkgrel=1
pkgdesc="Reverse differential backup tool"
# Requires unpackaged 'xattr'
options="!check"
url="https://rdiff-backup.net/"
arch="all"
license="GPL-2.0-or-later"
depends="python3 py3-yaml"
makedepends="
	librsync-dev
	python3-dev
	py3-gpep517
	py3-setuptools
	py3-wheel
	"
subpackages="
	$pkgname-pyc
	$pkgname-doc
	$pkgname-bash-completion
	"
source="https://github.com/rdiff-backup/rdiff-backup/releases/download/v$pkgver/rdiff-backup-$pkgver.tar.gz
	0002-remove-setuptools_scm.patch
	0003-fix-version.patch
	"

prepare() {
	default_prepare
	sed -e "s/%%PKGVER%%/$pkgver/" \
		-i setup.cfg
}

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

package() {
	python3 -m installer -d "$pkgdir" .dist/*.whl
}

sha512sums="
7370dcbb71f087252f8c599b0fbf58260ec7e026e023648bfab63c39b062120862ab8b60173e2bf2352e16d404bb561c72fe19aa9aed9d49cff56225b91f5c63  rdiff-backup-2.2.6.tar.gz
01014af9e1c562398b153900fe2db3e429408ce75dd72211121277d3f1b9133416f4ed4adedfe9d1da0a26fdb12c6c59f152cb02a717bf96bf61c64ef25f8586  0002-remove-setuptools_scm.patch
236314c5d51d600abbfb55f084b47e0d60e3182be69803bb0abeff50e0d8750ab29b603abbf39b1a6aa94fe7a6593e121abb330bb8a348fcc27c7a0c3f4bed0b  0003-fix-version.patch
"
